using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Runtime.Serialization;
using DIS_DAL_WS.Models;

namespace DIS_DAL_WS.DTO
{
    [DataContract]
	public class FunctionsDTO
	{
        [DataMember]
		public int ID { get; set; }
        [DataMember]
		public string Name { get; set; }

        public static FunctionsDTO Translate(Functions Entity)
        {
            if (Entity != null)
            {
                var dto = new FunctionsDTO
                {
                    ID = Entity.ID,
                    Name = Entity.Name
                };
                return dto;
            }
            return null;
        }

        public static Functions Reverse(FunctionsDTO obj)
        {
            var entity = new Functions
            {
                ID = obj.ID,
                Name = obj.Name
            };
            return entity;
        }

        public void UpdateEntity(ref Functions entity)
        {
            entity.Name = Name;
        }
	}
}